﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%@ include file="common/head.jsp" %>

<div class="b_wrap">
    <div class="current"><span>当前所在地：</span><a href="/">首页</a> >> <a href="会员中心.html">会员中心</a></div>

<%@ include file="common/body.jsp" %>

        <div class="fmright">
        	<div class="fmr1">
            	<div class="fmr1_top">我的订单</div>
                <div class="fmr1_m">
                	<div class="fmyor">
                    	<ul>
                        	<li class="f2">旅游订单</li>
                        </ul>
                    </div>
                    <div class="ftx">
                    	我的订单提醒：<a href="#">待付款</a>    <a href="#">待点评</a>
                    </div>
                      <div class="forder">
                        <div class="for_top">
                                <div class="for_t4">订单编号</div>
                                <div class="for_t2">产品信息</div>
                                <div class="for_t3">订单金额</div>
                                <div class="for_t3">订单状态</div>
                                <div class="for_t3">操作</div>
                                <br style="clear:both">
                            </div>           
               
                           
                            <div class="for_m" id="view_od">
                            </div>
                           <div id="pageod" ></div>
               
                        </div>
                </div>
            </div>
            <div class="fmr2">
            	<div class="fmr2_top"><span class="fspan4"><a href="#">更多>></a></span>杭州周边热门景点</div>
            	<div class="fmr2_m">
                	<div class="fmr2_m1">
                        <div class="fmr2_m1pic"><img src="statics/portal/images/fzbpic1.png"></div>
                        <div class="fmr2_m1text"><a href="#">西湖</a></div>
                    </div>
                    <div class="fmr2_m1">
                        <div class="fmr2_m1pic"><img src="statics/portal/images/fzbpic1.png"></div>
                        <div class="fmr2_m1text"><a href="#">西湖</a></div>
                    </div>
                    <div class="fmr2_m1">
                        <div class="fmr2_m1pic"><img src="statics/portal/images/fzbpic1.png"></div>
                        <div class="fmr2_m1text"><a href="#">西湖</a></div>
                    </div>
                    <div class="fmr2_m1">
                        <div class="fmr2_m1pic"><img src="statics/portal/images/fzbpic1.png"></div>
                        <div class="fmr2_m1text"><a href="#">西湖</a></div>
                    </div>
                    <div class="fmr2_m1">
                        <div class="fmr2_m1pic"><img src="statics/portal/images/fzbpic1.png"></div>
                        <div class="fmr2_m1text"><a href="#">西湖</a></div>
                    </div>
                    <div class="fmr2_m1">
                        <div class="fmr2_m1pic"><img src="statics/portal/images/fzbpic1.png"></div>
                        <div class="fmr2_m1text"><a href="#">西湖</a></div>
                    </div>
                    <div class="fmr2_m1">
                        <div class="fmr2_m1pic"><img src="statics/portal/images/fzbpic1.png"></div>
                        <div class="fmr2_m1text"><a href="#">西湖</a></div>
                    </div>
                    <div class="fmr2_m1">
                        <div class="fmr2_m1pic"><img src="statics/portal/images/fzbpic1.png"></div>
                        <div class="fmr2_m1text"><a href="#">西湖</a></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<script id="template_odr" type="text/html">
		{{#            	     for(var i=0;i<d.length;i++){                   }}
                        <div class="for_t4">
                          {{d[i].orderId}}<br>
                                </div>
                                <div class="for_t2">
                                    <img src={{d[i].titleImg}} width=20 align="absmiddle">&nbsp;<span class="fspan3">{{d[i].productName}}</span>
                                </div>
                                <div class="for_t3">{{d[i].payment}}</div>
                                <div class="for_t3">{{d[i].status}}</div>
                                <div class="for_t3"><a href="#">付款</a><a href="#" class="a1">查看</a></div>
                                <br style="clear:both">
		{{# } }}
</script>
<script type="text/javascript">
		$(function(){
			renderPage_tr();
		});
		
		//渲染分页元素
		function renderPage_tr() {
			//查询总数
			ajaxRequestJson("/order/getOrderCount.do", null, function(data) {
				var count = data.data;//总数
				var size = 2;//每页行数
		
				//渲染分页
				layui.use("laypage", function() {
					var laypage = layui.laypage;

					laypage.render({
						elem : "pageod",
						count : count,
						limit : size,
						theme : "#4287c2",
						jump : function(obj, first) {
						
							getData_tr(obj.curr,size);
						}
					});
				});
			});
		}

		//获取订单数据
		function getData_tr(nowPage,size) {
			ajaxRequestJson(
				"/order/getOrderList.do",
				{"nowPage":nowPage,"size":size},  
				function(data) {
					if (data.data != null) {
						//渲染页面
						renderData_tr_laytpl(data.data);
					} else {
// 						layer.msg("失败");
					}
			});
		}

		//模板引擎渲染页面
		function renderData_tr_laytpl(data) {
			layui.use("laytpl", function() {
				var laytpl = layui.laytpl;
				var template_odr = $("#template_odr").html();
				laytpl(template_odr).render(data, function(html) {
					$("#view_od").html(html);
				});
			});
		}
		</script>
		
<%@ include file="common/foot.jsp" %>